package chuyentrung.racehorses;

import java.util.Random;

import chuyentrung.racehorses.framework.GameObject;

public class Dice extends GameObject{
	public enum FaceDice {
		MOT_CHAM, HAI_CHAM, BA_CHAM, BON_CHAM, NAM_CHAM, SAU_CHAM
	}
	
	public static final float DICE_HEIGHT = 1.0f;
	public static final float DICE_WIDTH = 1.5f;

	public FaceDice currFace;
	public int stateTime;
	public Random random;

	public Dice(float x, float y) {
		super(x, y, 1f, 1f);
		random = new Random(6);
		currFace = FaceDice.BON_CHAM;
		stateTime = 0;
	}
	
	public void update(float deltaTime) {
		stateTime += deltaTime;
	}

	public FaceDice rotate() {
		int value = random.nextInt(6);
		switch (value) {
		case 0:
			currFace = FaceDice.MOT_CHAM;
			break;
		case 1:
			currFace = FaceDice.HAI_CHAM;
			break;
		case 2:
			currFace = FaceDice.BA_CHAM;
			break;
		case 3:
			currFace = FaceDice.BON_CHAM;
			break;
		case 4:
			currFace = FaceDice.NAM_CHAM;
			break;
		case 5:
			currFace = FaceDice.SAU_CHAM;
			break;
		}

		return currFace;
	}
}
